// app.js
App({
  globalData: {
    usercoden:'',
    usercode:'',
    ifready:'true',
    //拍照的类型
    photoType:'',
    //正在请求的用户
    nowQuest:{},
    //诊断数据模板
    dignos:{time:'',grad:'',data:'',message:''},
    socketStatus: 'closed',
    socketOpen:false,
    userList:[{
      userurlid:0,
      userurl:'https://gitee.com/ToBugCoding/my-photo-bed/raw/master/imgurl/%E5%85%AC%E5%8F%B8%E5%B0%8F%E7%A8%8B%E5%BA%8F%E9%87%8D%E5%86%99/tooth4/father.png',
      usergender:'性别',
      userrelation:'输入关系',
      userage:'年龄',
      userdignos:[],
      userAQ:0,
    },{
      userurlid:1,
      userurl:'https://gitee.com/ToBugCoding/my-photo-bed/raw/master/imgurl/%E5%85%AC%E5%8F%B8%E5%B0%8F%E7%A8%8B%E5%BA%8F%E9%87%8D%E5%86%99/tooth4/mother.png',
      usergender:'性别',
      userrelation:'输入关系',
      userage:'年龄',
      userdignos:[],
      userAQ:0,
    },{
      userurlid:2,
      userurl:'https://gitee.com/ToBugCoding/my-photo-bed/raw/master/imgurl/%E5%85%AC%E5%8F%B8%E5%B0%8F%E7%A8%8B%E5%BA%8F%E9%87%8D%E5%86%99/tooth4/child.png',
      usergender:'性别',
      userrelation:'输入关系',
      userage:'年龄',
      userdignos:[],
      userAQ:0,
    },{
      userurlid:3,
      userurl:'https://gitee.com/ToBugCoding/my-photo-bed/raw/master/imgurl/%E5%85%AC%E5%8F%B8%E5%B0%8F%E7%A8%8B%E5%BA%8F%E9%87%8D%E5%86%99/tooth4/childson.png',
      usergender:'性别',
      userrelation:'输入关系',
      userage:'年龄',
      userdignos:[],
      userAQ:0,
    }],
    //用户头像信息
    headUrlStander:['https://gitee.com/ToBugCoding/my-photo-bed/raw/master/imgurl/%E5%85%AC%E5%8F%B8%E5%B0%8F%E7%A8%8B%E5%BA%8F%E9%87%8D%E5%86%99/tooth4/father.png','https://gitee.com/ToBugCoding/my-photo-bed/raw/master/imgurl/%E5%85%AC%E5%8F%B8%E5%B0%8F%E7%A8%8B%E5%BA%8F%E9%87%8D%E5%86%99/tooth4/mother.png','https://gitee.com/ToBugCoding/my-photo-bed/raw/master/imgurl/%E5%85%AC%E5%8F%B8%E5%B0%8F%E7%A8%8B%E5%BA%8F%E9%87%8D%E5%86%99/tooth4/child.png','https://gitee.com/ToBugCoding/my-photo-bed/raw/master/imgurl/%E5%85%AC%E5%8F%B8%E5%B0%8F%E7%A8%8B%E5%BA%8F%E9%87%8D%E5%86%99/tooth4/childson.png'],
    //用户信息历史报告
    videoUrl:""
  },
  onShow:function (options) {
    var that=this;
      console.log(options.scene)
      console.log(options.query.userid)
      console.log(options.query.type)
      if(options.query.type==12)
      {
        console.log("接收到好友分享，准备绑定关系")
      }
  },
  onLaunch: function () {
    var that=this;
   

    wx.login({
      success: (res) => {
        if(res.code) {
          that.globalData.usercoden=res.code
          wx.request({
            url: 'https://www.aistomatology.cn/wx/login',
            method: 'GET',
            header:{  
              'content-type':'application/json'
          },
          data: {
                 code:res.code
           },
           success:function(savedata){
             //console.log(savedata.data)
             
             that.globalData.usercode=savedata.data.openid
           }
  })
}
      },
    })
  },


})